<template>
  <div class="search">
    <el-form :inline="true" :model="searchInfo" class="demo-form-inline">
      <el-form-item>
        <el-input v-model="searchInfo.stuNum" placeholder="请输入学号查询"></el-input>
      </el-form-item>
      <el-form-item>
        <el-input v-model="searchInfo.userInfo.stuName" placeholder="请输入姓名查询"></el-input>
      </el-form-item>
      <el-form-item>
        <el-input v-model="searchInfo.adminInfo.adminName" :placeholder="`请输入${searchType}老师姓名查询`"></el-input>
      </el-form-item>
      <el-form-item>
        <el-select v-model="searchInfo.userInfo.stuAddress" placeholder="请选择校区">
          <el-option label="请选择校区" value=""></el-option>
          <el-option value="汇南校区"></el-option>
          <el-option value="宜宾校区"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-select v-model="searchInfo.userInfo.stuMajor" placeholder="选择学院">
          <el-option label="请选择学院" value=""></el-option>
          <el-option value="软件工程"></el-option>
          <el-option value="金融"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-select v-model="searchInfo.visitStatus" :placeholder="`${searchType}状态`">
          <el-option :label="`请选择${searchType}状态`" value=""></el-option>
          <el-option :label="`等待${searchType}`" value="3"></el-option>
          <el-option :label="`${searchType}中`" value="1"></el-option>
          <el-option :label="`${searchType}结束`" value="2"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-select v-model="searchInfo.visitConclusion" :placeholder="`${searchType}结果`">
          <el-option :label="`请选择${searchType}结果`" value=""></el-option>
          <el-option label="转介送诊" value="0"></el-option>
          <el-option label="安排咨询" value="1"></el-option>
          <el-option label="无需咨询" value="2"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-select v-model="searchInfo.visitTime">
          <el-option :label="`请选择${searchType}时间`" value=""></el-option>
          <el-option value="8:00-10:00"></el-option>
          <el-option value="10:00-12:00"></el-option>
          <el-option value="14:00-16:00"></el-option>
          <el-option value="16:00-18:00"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit(0)">查询</el-button>
      </el-form-item>
      <el-radio-group v-model="searchInfo.visitDate" @change="onSubmit(1)">
        <el-radio-button label="周一"></el-radio-button>
        <el-radio-button label="周二"></el-radio-button>
        <el-radio-button label="周三"></el-radio-button>
        <el-radio-button label="周四"></el-radio-button>
        <el-radio-button label="周五"></el-radio-button>
        <el-radio-button label="">全部</el-radio-button>
      </el-radio-group>
    </el-form>
  </div>
</template>
<script>
export default {
  data() {
    return {
      searchInfo: {
        stuNum: "",
        visitStatus: "",
        visitConclusion: "",
        visitDate: "",
        visitTime: "",
        userInfo: {
          stuName: "",
          stuAddress: "",
          stuMajor: "",
        },
        adminInfo:{
          adminName:""
        },
      },
    };
  },
  props: {
    searchType: String,
  },
  methods: {
    async onSubmit(num) {
      if (this.searchType == '初访') {
        this.$emit('initiaSearch', this.searchInfo,num);
      } else {
        this.$emit('consultSearch', this.searchInfo,num);
      }
    },
    handleSizeChange(val) {
    },
    handleCurrentChange(val) {
    },
  },
};
</script>
<style scoped>
button.el-button.el-button--primary {
  margin-left: 10px;
}
</style>
